import axios from '@/utils/fetch'
const _module = '/systemMenu'
export default {
  // 分销商/渠道商/影院 获取权限树
  getMenuTreeByType (params) {
    return axios({ url: `${_module}/getMenuTreeByType`, params })
  },
  // 权限菜单管理
  getMenuListByParentId (params) {
    return axios({ url: `${_module}/getMenuListByParentId`, params })
  },
  getMenuListByParentIds (parentIds) {
    return axios({
      url: `${_module}/getMenuListByParentIds`,
      params: { parentId: parentIds.join(',') }
    })
  },
  getMenuTree (params) {
    return axios({ url: `${_module}/getMenuTree`, params })
  },
  getAccountMenuTree (params) {
    return axios({
      url: `${_module}/getAccountMenuTree`,
      params
    })
  },
  getMenuInfo (params) {
    return axios({ url: `${_module}/getInfo`, params })
  },
  createMenu (params) {
    return axios({ url: `${_module}/create`, params })
  },
  updateMenu (params) {
    return axios({ url: `${_module}/edit`, params })
  },
  menuSort (params) {
    return axios({ url: `${_module}/menuSort`, params })
  },
  deleteMenu (menuId) {
    return axios({ url: `${_module}/delete`, params: { menuId } })
  },
  setMenuStatus ({ menuId, status }) {
    return axios({ url: `${_module}/setStatus`, params: { menuId, status } })
  },
  getAccountMenuList (userId) {
    return axios({ url: `${_module}/getAccountMenuList`, params: { userId } })
  },

  // 获取商户菜单
  getBusinessMenuTree (params) {
    return axios({ url: `${_module}/getBusinessMenuTree`, params })
  },

  // getMenuChildren
  getMenuChildren (params) {
    return axios({ url: `${_module}/getMenuChildren`, params })
  }
}
